package springdemo03.dao;

import org.springframework.jdbc.core.JdbcTemplate;
import springdemo03.pojo.Book;

/**
 * @ Author     ：LILA3
 * @ Date       ：Created in 1:59 PM 7/26/2018
 */
public class BookDao implements BaseDao<Book> {

    JdbcTemplate jdbcTemplate;

    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
        this.jdbcTemplate = jdbcTemplate;
    }

    @Override
    public int insert(Book book) {
        String sql = "insert into Book(id, name)values(?,?)";
        return jdbcTemplate.update(sql, book.getId(), book.getName());
    }

    @Override
    public int update(Book book) {
        return 0;
    }

    @Override
    public int delete(Book book) {
        return 0;
    }

    @Override
    public Book find() {
        return null;
    }
}
